Skip to content

Add React Testing Library UI component tests#11

Merged
riccjohn merged 6 commits into
mainfrom
feature/react-testing-library
Mar 6, 2026
Merged

Add React Testing Library UI component tests#11
riccjohn merged 6 commits into
mainfrom
feature/react-testing-library

Conversation

@riccjohn
Copy link
Copy Markdown
Owner

@riccjohn riccjohn commented Mar 6, 2026

Summary

  • Install @testing-library/react, @testing-library/user-event, @testing-library/jest-dom, and jsdom as dev dependencies
  • Configure Vitest with environment: "jsdom" and a vitest.setup.ts that registers jest-dom matchers
  • Add 22 tests across all four UI components (51 total passing, including pre-existing ingest tests)

Test coverage

File Tests
components/Message.test.tsx Role labels, content rendering, streaming cursor
components/ChatInput.test.tsx Submit on click/Enter, Shift+Enter guard, disabled state, clear on submit
components/MessageList.test.tsx Empty state, message rendering, loading indicator, streaming flag
components/ThemeToggle.test.tsx Dark/light label, toggle behavior, localStorage persistence

Test plan

  • pnpm test passes with 51/51 tests and no warnings

🤖 Generated with Claude Code

- Install @testing-library/react, @testing-library/user-event, @testing-library/jest-dom, jsdom
- Configure Vitest with jsdom environment and jest-dom setup file
- Add 22 tests across ChatInput, Message, MessageList, ThemeToggle components

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
grimoire-oracle-web Ready Ready Preview, Comment Mar 6, 2026 3:44pm

riccjohn and others added 5 commits March 6, 2026 09:38
- Install @testing-library/react, @testing-library/user-event, @testing-library/jest-dom, jsdom
- Configure Vitest with jsdom environment and jest-dom setup file
- Add 22 tests across ChatInput, Message, MessageList, ThemeToggle components

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rimoire-oracle-web into feature/react-testing-library

# Conflicts:
#	components/MessageList.test.tsx
#	components/ThemeToggle.test.tsx
#	package.json
#	pnpm-lock.yaml
@riccjohn riccjohn merged commit 627158c into main Mar 6, 2026
3 checks passed
@riccjohn riccjohn deleted the feature/react-testing-library branch March 6, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant